/**
 * @Author lilinjie
 * @Description: 订单API
 */
import http from '@/utils/request'

// 获得订单
export const getAllOrder = ({ current: pageNum, pageSize }) => http({
  method: 'GET',
  url: `/admin/order/getDetailInfoByOrderId/${pageNum}/${pageSize}`
})

// 添加订单
export const addOrder = (data) => http({
  method: 'POST',
  url: `/admin/order/insertOrder`,
  data
})

// 删除订单
export const deleteOrder = (id) => http({
  method: 'GET',
  url: `/admin/order/deleteOrder`,
  params: { id }
})

// 条件查询订单
export const searchOrder = ({ orderNum, orderStatus, payType, current: pageNum, pageSize }) => http({
  method: 'POST',
  url: `/admin/order/getOrderByQueryParam`,
  params: {
    pageNum,
    pageSize
  },
  data: {
    orderNum,
    orderStatus,
    payType
  }
})

// 订单详情
export const getOrderDetail = (orderId) => http({
  method: 'GET',
  url: `/admin/order/getDetailInfoByOrderId/${orderId}`
})
